﻿using System;

public enum Specialty { kopa4, seq4, traktorist, agrar, kravar}

public enum University {SU, TU, NBU}

public enum Faculty {FF,FMI,HF,FzF }

public class Student : ICloneable, IComparable
{
    public string FirstName { get;set;}

    public string MiddleName { get; set;}
    
    public string LastName { get; set;}

    public string SSN { get; set; }
    
    public string PermanentAddress { get; set; }
    
    public string MobilePhone { get; set; }
    
    public string eMail { get; set; }
    
    public int Course { get; set; }

    public Specialty Specialty { get; set; }
    
    public University University { get; set; }
    
    public Faculty Faculty { get; set; }

    public Student(string FirstName, string MiddleName, string LastName, string PermanentAddress,
        string MobilePhone, string eMail, int Course, Specialty Specialty, University University, Faculty Faculty )
    
    {
        this.FirstName = FirstName;
        this.MiddleName = MiddleName;
        this.LastName = LastName;
        this.SSN = SSN;
        this.PermanentAddress = PermanentAddress;
        this.MobilePhone = MobilePhone;
        this.eMail = eMail;
        this.Course = Course;
        this.Specialty = Specialty;
        this.University = University;
        this.Faculty = Faculty;
    }

    public override string ToString()
    {
        return FirstName + " " + MiddleName + " " + LastName + " " + SSN + " " + PermanentAddress + " " + MobilePhone
                + " " + eMail + " " + Course + " " + Specialty + " " + University + " " + Faculty;
    }

    public override bool Equals(object obj)
    {
        if (obj == null) return false;

        if (obj.GetType() != this.GetType())
            return false;

        if (this.ToString() != obj.ToString()) 
            return false;

        return true;
    }

    public override int GetHashCode()
    {
        int result = 0;

        result += SSN.GetHashCode();
        result += (FirstName + MiddleName + LastName).GetHashCode();

        return result;
    }

    public static bool operator == (Student StudentA, Student StudentB)
    {
        if (StudentA.Equals(StudentB)) 
            return true;

        return false;
    }

    public static bool operator != (Student StudentA, Student StudentB)
    {
        if (StudentA == StudentB)
            return false;

        return true;
    }

    public object Clone()
    {
        Student clonedOne = new Student(FirstName, MiddleName, LastName, 
            PermanentAddress, MobilePhone, eMail, Course, Specialty, University,Faculty);

        return (object)clonedOne;
    }

    public int CompareTo(object obj)
    {
        


        throw new NotImplementedException();
    }
}

public class Person
{
    public string Name { get; set; }
    public int? Age { get; set; }

    public Person(string name) : this (name,null)
    {}

    public Person(string name, int? age)
    {
        this.Name = name;
        this.Age = age;
    }

    public override string ToString()
    {
        string result = "";
        result += this.Name + " ";

        if (this.Age == null)
        {
            result += "N/A age";
        }else
            result += Age.ToString();

        return result ;
    }
}

class CommonTypeSystem
{
    static void Main(string[] args)
    {
        //Student Icaka = new Student("Hristo", "I.", "Georgiev", "tam nqkade", "0883 542 435", 
        //    "abc@awe.dk", 1, Specialty.agrar, University.SU, Faculty.FMI);

        //Student Icaka2 = new Student("Hristo", "I.", "Georgiev", "tam nqkade", "0883 542 435",
        //    "abc@awe.dk", 1, Specialty.agrar, University.SU, Faculty.FMI);

        //Student BadStudent = null;
        //Student Cloning = (Student) Icaka.Clone();

        //Console.WriteLine(Cloning);

        //Console.WriteLine(Icaka == BadStudent);
        //Console.WriteLine(Icaka != Icaka2);




    }
}